package com.xbongbong.lfasr.model;

import lombok.Getter;
import lombok.Setter;

import java.io.File;
import java.util.HashMap;

/**
　* @Description: ${todo}
　* @param ${tags}
  * @return ${return_type}
　* @throws
　* @author youli.chen
  * @date 2019/3/13 20:18
　*/
@Setter
@Getter
public class UploadParams {
    private Signature signature;
    private LfasrType lfasr_type;
    private String task_id;
    private File file;
    private int slice_num;
    private String client_version;
    private double check_length;
    private HashMap<String, String> params;

    public UploadParams() {
        this.check_length = -1.0D;
        this.params = null;
    }

    public UploadParams(Signature signature, File file, LfasrType lfasr_type, HashMap<String, String> params, String task_id) {
        this(signature, file, lfasr_type, params);
        this.task_id = task_id;
    }

    public UploadParams(Signature signature, File file, LfasrType lfasr_type, HashMap<String, String> params) {
        this.check_length = -1.0D;
        this.params = null;
        this.signature = signature;
        this.file = file;
        this.lfasr_type = lfasr_type;
        this.params = params;
    }


    public String getTaskId() {
        return this.task_id;
    }

    public void setTaskId(String task_id) {
        this.task_id = task_id;
    }


    public LfasrType getLfasrType() {
        return this.lfasr_type;
    }

    public void setLfasrType(LfasrType lfasr_type) {
        this.lfasr_type = lfasr_type;
    }

    public int getSliceNum() {
        return this.slice_num;
    }

    public void setSliceNum(int slice_num) {
        this.slice_num = slice_num;
    }

    public String getClientVersion() {
        return this.client_version;
    }

    public void setClientVersion(String client_version) {
        this.client_version = client_version;
    }

    public Double getCheckLength() {
        return this.check_length;
    }

    public void setCheckLength(Double check_length) {
        this.check_length = check_length;
    }

    @Override
    public String toString() {
        return String.format("[appid:%s,ts:%s,signa:%s,lfasrType:%s,task_id:%s,file_name:%s]", this.signature.getAppID(), this.signature.getTs(), this.signature.getSigna(), this.lfasr_type, this.task_id, this.file.getName());
    }
}
